package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderMapper {
    //插入订单
    @Insert("insert into orders values(#{id},#{number},#{status},#{userId},#{addressBookId},#{orderTime},#{checkoutTime},#{payMethod},#{amount},#{remark},#{phone},#{address},#{userName},#{consignee})")
    void save(Orders orders);
    /*订单分页查询*/
    List<Orders> findByNumber(@Param("number") Long number, @Param("beginTime") String beginTime, @Param("endTime") String endTime);
    /*历史分页查询*/
    @Select("select * from orders")
    List<Orders> findOrders();
}
